home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / windows / tpwin31.zip / PENWIN.PAS < prev    next >
Pascal/Delphi Source File  |  1992-04-06  |  35KB  |  1,166 lines

  1. {*******************************************************}
  2. {                                                       }
  3. {       Turbo Pascal for Windows Run-time Library       }
  4. {       Windows 3.1 API Interface Unit                  }
  5. {       Pen Windows Interface unit                      }
  6. {                                                       }
  7. {       Copyright (c) 1992 Borland International        }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. unit PenWin;
  12.  
  13. {$S-}
  14.  
  15. interface
  16.  
  17. uses WinTypes, WinProcs, Win31;
  18.  
  19. {***** General Pen Windows Definitions ************************************}
  20. type
  21.   TRec = Integer;
  22.   PSYV = ^TSYV;
  23.   TSYV = Longint;
  24.   THRec = THandle;
  25.   TCL = Integer;
  26.   TALC = Longint;
  27.   THKP = Word;
  28.  
  29. type
  30.   TDF = function(dirq: Integer; InP, OutP: Pointer; Max: Integer;
  31.     Context, Data : Longint): Integer;
  32.  
  33. const
  34.   BitPenup               = $8000;
  35.  
  36. function FPenUp(X: LongInt): Boolean;
  37. inline(
  38.   $58/          { POP     AX }
  39.   $5A/          { POP     DX }
  40.   $2D/$00/$80/  { SUB     AX,8000H }
  41.   $1B/$C0/      { SBB     AX,AX }
  42.   $40);         { INC     AX }
  43.  
  44. { Default pen cursor to indicate writing, points northwest }
  45. const
  46.  IDC_Pen           = MakeIntResource(32631);
  47.  
  48. { alternate select cursor: upsidedown standard arrow, points southeast }
  49. const
  50.   IDC_AltSelect    = MakeIntResource(32501);
  51.  
  52. const
  53.   rc_WDefault            = $FFFF;
  54.   rc_Ldefault            = $FFFFFFFF;
  55.   rc_WDefaultFlags       = $8000;
  56.   rc_LDefaultFlags       = $80000000;
  57.  
  58. { HIWORD(SYV) defines and detection macros }
  59.  
  60. const
  61.   syvhi_Special          = 0;
  62.   syvhi_ANSI             = 1;
  63.   syvhi_Gesture          = 2;
  64.   syvhi_Kanji            = 3;
  65.   syvhi_Shape            = 4;
  66.   syvhi_UniCode          = 5;
  67.   syvhi_VKey             = 6;
  68.  
  69. function FIsSpecial(syv: TSYV): Boolean;
  70. function FIsAnsi(syv: TSYV): Boolean;
  71. function FIsGesture(syv: TSYV): Boolean;
  72. function FIsKanji(syv: TSYV): Boolean;
  73. function FIsShape(syv: TSYV): Boolean;
  74. function FIsUniCode(syv: TSYV): Boolean;
  75. function FIsVKey(syv: TSYV): Boolean;
  76.  
  77.  
  78. { Macros to convert between SYV and ANSI }
  79. function ChSyvToAnsi(syv: TSYV): Byte;
  80. function SyvCharacterToSymbol(c: Char): TSYV;
  81. function SyvKanjiToSymbol(c: Char): TSYV;
  82.  
  83. { SYV values with special meanings to Pen Windows }
  84.  
  85. const
  86.   syv_Null               = $00000000;
  87.   syv_Unknown            = $00000001;
  88.   syv_Empty              = $00000003;
  89.   syv_BeginOr            = $00000010;
  90.   syv_EndOr              = $00000011;
  91.   syv_Or                 = $00000012;
  92.   syv_SoftNewLine        = $00000020;
  93.   syv_SpaceNull          = $00010000;
  94.  
  95. { SYV values for gestures (map into UNICODE space) }
  96.  
  97. const
  98.   syv_KKConvert          = $0002FFD4;
  99.   syv_Clear              = $0002FFD5;
  100.   syv_ExtendSelect       = $0002FFD8;
  101.   syv_Undo               = $0002FFD9;
  102.   syv_Copy               = $0002FFDA;
  103.   syv_Cut                = $0002FFDB;
  104.   syv_Paste              = $0002FFDC;
  105.   syv_ClearWord          = $0002FFDD;
  106.   syv_User               = $0002FFDE;  { Reserved }
  107.   syv_Correct            = $0002FFDF;
  108.  
  109.   syv_Backspace          = $00020008;
  110.   syv_Tab                = $00020009;
  111.   syv_Return             = $0002000D;
  112.   syv_Space              = $00020020;
  113.  
  114.  
  115. function FIsStdGesture(syv: TSYV): Boolean;
  116. function FIsAnsiGesture(syv: TSYV): Boolean;
  117.  
  118.  
  119. { Application specific gestures, Circle a-z and Circle A-Z }
  120. const
  121.   syv_AppGestureMask     = $00020000;
  122.   syv_CircleUpA          = $000224B6;
  123.   syv_CircleUpZ          = $000224CF;
  124.   syv_CircleLoA          = $000224D0;
  125.   syv_CircleLoZ          = $000224E9;
  126.  
  127. { Gesture Macros }
  128.  
  129. function FIsLoAppGesture(syv: TSYV): Boolean;
  130. function FIsUpAppGesture(syv: TSYV): Boolean;
  131. function FIsAppGesture(syv: TSYV): Boolean;
  132.  
  133. function SyvAppGestureFromLoAnsi(Ansi: Char): TSYV;
  134. function SyvAppGestureFromUpAnsi(Ansi: Char): TSYV;
  135. function AnsiFromSyvAppGesture(syv: TSYV): Byte;
  136.  
  137.  
  138.  
  139. { SYV definitions for shapes }
  140.  
  141. const
  142.   syv_ShapeLine          = $00040001;
  143.   syv_ShapeEllipse       = $00040002;
  144.   syv_ShapeRect          = $00040003;
  145.   syv_ShapeMin           = syv_ShapeLine;
  146.   syv_ShapeMax           = syv_ShapeRect;
  147.  
  148. {***** Recognition Error Codes ********************************************}
  149. const
  150.   rec_OEM                = -1024;
  151.   rec_Language           = -48;
  152.   rec_Guide              = -47;
  153.   rec_ParamError         = -46;
  154.   rec_InvalidRef         = -45;
  155.   rec_RectExclude        = -44;
  156.   rec_RectBound          = -43;
  157.   rec_PCM                = -42;
  158.   rec_ResultMode         = -41;
  159.   rec_HWnd               = -40;
  160.   rec_ALC                = -39;
  161.   rec_ErrorLevel         = -38;
  162.   rec_CLVerify           = -37;
  163.   rec_Dict               = -36;
  164.   rec_HRec               = -35;
  165.   rec_BadEventRef        = -33;
  166.   rec_NoCollection       = -32;
  167.  
  168.   rec_Debug              = -32;
  169.  
  170.   rec_PointerEvent       = -31;
  171.   rec_BadHPenData        = -9;
  172.   rec_OOM                = -8;
  173.   rec_NoInput            = -7;
  174.   rec_NoTablet           = -6;
  175.   rec_Busy               = -5;
  176.   rec_BufferTooSmall     = -4;
  177.   rec_Abort              = -3;
  178.  
  179.   rec_Overflow           = -1;
  180.  
  181.   rec_OK                 = 0;
  182.   rec_TermBound          = 1;
  183.   rec_TermEx             = 2;
  184.   rec_TermPenUp          = 3;
  185.   rec_TermRange          = 4;
  186.   rec_TermTimeOut        = 5;
  187.   rec_Done               = 6;
  188.   rec_TermOEM            = 512;
  189.  
  190. {***** Pen Driver Structures and Entry points *****************************}
  191.  
  192. type
  193.   POEMPenInfo = ^TOEMPenInfo;
  194.   TOEMPenInfo = record
  195.     wPdt: Word;
  196.     wValueMax: Word;
  197.     wDistinct: Word;
  198.   end;
  199.  
  200. const
  201.   pdt_Null               = 0;
  202.   pdt_Pressure           = 1;
  203.   pdt_Height             = 2;
  204.   pdt_AngleXY            = 3;
  205.   pdt_AngleZ             = 4;
  206.   pdt_BarrelRotation     = 5;
  207.   pdt_OEMSpecific        = 16;
  208.  
  209.   MaxOEMDataWords        = 6;
  210.  
  211. type
  212.   PPenPacket = ^TPenPacket;
  213.   TPenPacket = record
  214.     wTabletX: Word;
  215.     wTabletY: Word;
  216.     wPDK: Word;
  217.     rgwOemData: array[0..MaxOEMDataWords - 1] of Word;
  218.   end;
  219.  
  220. type
  221.   TRawHook = function(PenPacket: PPenPacket): Bool;
  222.  
  223. type
  224.   PPenInfo = ^TPenInfo;
  225.   TPenInfo = record
  226.     cxRawWidth: Word;
  227.     cyRawHeight: Word;
  228.     wDistinctWidth: Word;
  229.     wDistinctHeight: Word;
  230.     nSamplingRate: Integer;
  231.     nSamplingDist: Integer;
  232.     lPdc: Longint;
  233.     cPens: Integer;
  234.     cbOemData: Integer;
  235.     rgoempeninfo: array[0..MaxOEMDataWords - 1] of TOEMPenInfo;
  236.     rgwReserved: array[0..7] of Word;
  237.   end;
  238.  
  239. const
  240.   pdc_Integrated         = $00000001;
  241.   pdc_Proximity          = $00000002;
  242.   pdc_Range              = $00000004;
  243.   pdc_Invert             = $00000008;
  244.   pdc_Relative           = $00000010;
  245.   pdc_Barrel1            = $00000020;
  246.   pdc_Barrel2            = $00000040;
  247.   pdc_Barrel3            = $00000080;
  248.  
  249. type
  250.   PStrokeInfo = ^TStrokeInfo;
  251.   TStrokeInfo = record
  252.     cPnt: Word;
  253.     cbPnts: Word;
  254.     wPDK: Word;
  255.     dwTick: Longint;
  256.   end;
  257.  
  258. type
  259.   PCalbStruct = ^TCalbStruct;
  260.   TCalbStruct = record
  261.     wOffsetX: Integer;
  262.     wOffsetY: Integer;
  263.     wDistinctWidth: Integer;
  264.     wDistinctHeight: Integer;
  265.   end;
  266.  
  267. {***** DRV_ values for pen driver specific messages ***********************}
  268.  
  269. const
  270.   drv_SetPenDriverEntryPoints    = drv_Reserved+1;
  271.   drv_RemovePenDriverEntryPoints = drv_Reserved+2;
  272.   drv_SetPenSamplingRate         = drv_Reserved+3;
  273.   drv_SetPenSamplingDist         = drv_Reserved+4;
  274.   drv_GetName                    = drv_Reserved+5;
  275.   drv_GetVersion                 = drv_Reserved+6;
  276.   drv_GetPenInfo                 = drv_Reserved+7;
  277.   drv_GetCalibration             = drv_Reserved+11;
  278.   drv_SetCalibration             = drv_Reserved+12;
  279.  
  280. procedure UpdatePenInfo(lpPenInfo: PPenInfo);
  281. function EndPenCollection(recEnd: TRec): Bool;
  282. function GetPenHwData(lpPnt: PPoint; lpvOemData: Pointer; cPntMax: Integer;
  283.   wTimeOut: Word; lpsi: PStrokeInfo): TRec;
  284. function GetPenHwEventData(wEventRefBeg: Word; wEventRefEnd: Word;
  285.   lpPnt: PPoint; lpvOemData: Pointer; cPntMax: Integer; lpsi: PStrokeInfo): TRec;
  286.  
  287. (*  This procedure not exported by PENWIN.DLL or MARS.DLL
  288. procedure PenPacket;
  289. *)
  290.  
  291. function SetPenHook(hkpOp: THKP; lptn: TRawHook): Bool;
  292.  
  293. {***** Pen Hardware Constants *********************************************}
  294.  
  295. const
  296.   pdk_Up                 = $0000;
  297.   pdk_Down               = $0001;
  298.   pdk_Barrel1            = $0002;
  299.   pdk_Barrel2            = $0004;
  300.   pdk_Barrel3            = $0008;
  301.   pdk_Transition         = $0010;
  302.   pdk_Inverted           = $0080;
  303.   pdk_OutOfRange         = $4000;
  304.   pdk_Driver             = $8000;
  305.   pdk_TipMask            = $0001;
  306.   pdk_Switches           = pdk_Down or pdk_Barrel1 or pdk_Barrel2 or
  307.                            pdk_Barrel3;
  308.  
  309. const
  310.   pcm_Penup              = $00000001;
  311.   pcm_Range              = $00000002;
  312.   pcm_Invert             = $00000020;
  313.   pcm_RectExclude        = $00002000;
  314.   pcm_RectBound          = $00004000;
  315.   pcm_Timeout            = $00008000;
  316.   pcm_AddDefaults        = rc_LDefaultFlags; { $80000000 }
  317.  
  318. {***** Virtual Event Layer ************************************************}
  319.  
  320. procedure PostVirtualKeyEvent(vk: Word; fUp: Bool);
  321. procedure PostVirtualMouseEvent(wMouseFlag: Word; xPos, yPos: Integer);
  322. procedure AtomicVirtualEvent(fBegin: Bool);
  323.  
  324. const
  325.   vwm_MouseMove          = $0001;
  326.   vwm_MouseLeftDown      = $0002;
  327.   vwm_MouseLeftUp        = $0004;
  328.   vwm_MouseRightDown     = $0008;
  329.   vwm_MouseRightUp       = $0010;
  330.  
  331. {***** RC Definition ******************************************************}
  332.  
  333. const
  334.   cl_Null                = 0;
  335.   cl_Minimum             = 1;
  336.   cl_Maximum             = 100;
  337.   InkWidth_Minimum       = 0;
  338.   InkWidth_Maximum       = 15;
  339.   enum_Minimum           = 1;
  340.   enum_Maximum           = 4096;
  341.   MaxDictionaries        = 16;
  342.  
  343. type
  344.   PGuide = ^TGuide;
  345.   TGuide = record
  346.     xOrigin: Integer;
  347.     yOrigin: Integer;
  348.     cxBox: Integer;
  349.     cyBox: Integer;
  350.     cxBase: Integer;
  351.     cyBase: Integer;
  352.     cHorzBox: Integer;
  353.     cVertBox: Integer;
  354.     cyMid: Integer;
  355.   end;
  356.  
  357. type
  358.   TRCYieldProc = function : Bool;
  359.  
  360. const
  361.   cbRcLanguageMax        = 44;
  362.   cbRcUserMax            = 32;
  363.   cbRcrgbfAlcMax         = 32;
  364.   cwRcReservedMax        = 8;
  365.  
  366. type
  367.   PRC = ^TRC;
  368.   TRC = record
  369.     HRec: THRec;
  370.     hw: HWnd;
  371.     wEventRef: Word;
  372.     wRcPreferences: Word;
  373.     lRcOptions: Longint;
  374.     lpfnYield: TRCYieldProc;
  375.     lpUser: array[0..cbRcUserMax-1] of Byte;
  376.     wCountry: Word;
  377.     wIntlPreferences: Word;
  378.     lpLanguage: array[0..cbRcLanguageMax-1] of Char;
  379.     rglpdf: array[0..MaxDictionaries-1] of TDF;
  380.     wTryDictionary: Word;
  381.     clErrorLevel: TCL;
  382.     alc: TALC;
  383.     alcPriority: TALC;
  384.     rgbfAlc: array[0..cbRcrgbfAlcMax-1] of Byte;
  385.     wResultMode: Word;
  386.     wTimeOut: Word;
  387.     lPcm: Longint;
  388.     rectBound: TRect;
  389.     rectExclude: TRect;
  390.     guide: TGuide;
  391.     wRcOrient: Word;
  392.     wRcDirect: Word;
  393.     nInkWidth: Integer;
  394.     rgbInk: TColorRef;
  395.     dwAppParam: Longint;
  396.     dwDictParam: Longint;
  397.     dwRecognizer: Longint;
  398.     rgwReserved: array[0..cwRcReservedMax-1] of Word;
  399.   end;
  400.  
  401. type
  402.   THPenData = THandle;
  403.  
  404. type
  405.   PSYC = ^TSYC;
  406.   TSYC = record
  407.     wStrokeFirst: Word;
  408.     wPntFirst: Word;
  409.     wStrokeLast: Word;
  410.     wPntLast: Word;
  411.     fLastSyc: Bool;
  412.   end;
  413.     
  414. const
  415.   wPntAll                = $FFFF;
  416.   iSycNull               = -1;
  417.  
  418. type
  419.   PSYE = ^TSYE;
  420.   TSYE = record
  421.     syv: TSYV;
  422.     lRecogVal: Longint;
  423.     cl: TCL;
  424.     iSyc: Integer;
  425.   end;
  426.  
  427. const
  428.   MaxHotSpot             = 8;
  429.  
  430. type
  431.   PSYG = ^TSYG;
  432.   TSYG = record
  433.     rgpntHotSpots: array[0..MaxHotSpot-1] of TPoint;
  434.     cHotSpot: Integer;
  435.     nFirstBox: Integer;
  436.     lRecogVal: Longint;
  437.     lpsye: PSYE;
  438.     cSye: Integer;
  439.     lpsyc: PSYC;
  440.     cSyc: Integer;
  441.   end;
  442.  
  443. type
  444.   TEnumProc = function(syv: PSYV; i: Integer; P: Pointer): Integer;
  445.  
  446. type
  447.   PRCResult = ^TRCResult;
  448.   TRCResult = record
  449.     syg: TSYG;
  450.     wResultsType: Word;
  451.     cSyv: Integer;
  452.     lpsyv: PSYV;
  453.     HSyv: THandle;
  454.     nBaseLine: Integer;
  455.     nMidLine: Integer;
  456.     hPenData: THPenData;
  457.     rectBoundInk: TRect;
  458.     pntEnd: TPoint;
  459.     lprc: PRC;
  460.   end;
  461.  
  462. const
  463.   rcrt_Default           = $0000;
  464.   rcrt_Unidentified      = $0001;
  465.   rcrt_Gesture           = $0002;
  466.   rcrt_NoSymbolMatch     = $0004;
  467.   rcrt_Private           = $4000;
  468.   rcrt_NoRecog           = $8000;
  469.   rcrt_AlreadyProcessed  = $0008;
  470.   rcrt_GestureTranslated = $0010;
  471.   rcrt_GestureToKeys     = $0020;
  472.  
  473.   hkp_SetHook            = 0;
  474.   hkp_Unhook             = $FFFF;
  475.   hwr_Results            = 0;
  476.   hwr_AppWide            = 1;
  477.  
  478.   pen_NoInkWidth         = 0;
  479.  
  480. const
  481.   rpa_Default            = 1;
  482.  
  483. { GetGlobalRC return codes }
  484. const
  485.   ggrc_OK                = 0;
  486.   ggrc_DictBufTooSmall   = 1;
  487.   ggrc_ParamError        = 2;
  488.  
  489. { SetGlobalRC return code flags }
  490. const
  491.   sgrc_OK                = $0000;
  492.   sgrc_User              = $0001;
  493.   sgrc_ParamError        = $0002;
  494.   sgrc_RC                = $0004;
  495.   sgrc_Recognizer        = $0008;
  496.   sgrc_Dictionary        = $0010;
  497.   sgrc_INIFile           = $0020;
  498.  
  499. { macro }
  500. function GetWEventRef: Word;
  501.  
  502. function InstallRecognizer(lpszRecogName: PChar): THRec;
  503. procedure UninstallRecognizer(HRec: THRec);
  504. function GetGlobalRC(lprc: PRC; lpDefRecog: PChar; lpDefDict: PChar;
  505.   cbDefDictMax: Integer): Word;
  506. function SetGlobalRC(lprc: PRC; lpDefRecog: PChar; lpDefDict: PChar): Word;
  507. procedure RegisterPenApp(wFlags: Word; fRegister: Bool);
  508. function IsPenAware: Word;
  509. function SetRecogHook(whrHook: Word; hkpPosition: Word; HWndHook: HWnd): Bool;
  510. procedure InitRC(hw: HWnd; lprc: PRC);
  511. function Recognize(lprc: PRC): TRec;
  512. function RecognizeData(lprc: PRC; hPenData: THPenData): TRec;
  513. function TrainInk(lprc: PRC; hPenData: THPenData; lpsyv: PSYV): Bool;
  514. function TrainContext(lprcresult: PRCResult; lpsye: PSYE; cSye: Integer;
  515.   lpsyc: PSYC; cSyc: Integer): Bool;
  516. function ProcessWriting(hw: HWnd; lprc: PRC): TRec;
  517. function CorrectWriting(hw:HWnd; lpBuf:PChar; cbBuf: Word; lprc: PRC;
  518.   dwCwrFlags: Longint; dwReserved: Longint): Bool;
  519. procedure EmulatePen(fPen: Bool);
  520. function GetSymbolMaxLength(lpsyg: PSYG): Integer;
  521. function GetSymbolCount(lpsyg: PSYG): Integer;
  522. procedure FirstSymbolFromGraph(lpsyg: PSYG; lpsyv: PSYV; cSyvMax: Integer;
  523.   lpcSyv: PInteger);
  524. function EnumSymbols(lpsyg: PSYG; wMaxStr: Word; lpEnumFunc: TEnumProc;
  525.   lvData: Pointer): Word;
  526.  
  527. {***** Miscellaneous Functions ********************************************}
  528.  
  529. function TPtoDP(lpPnt: PPoint; cPnt: Integer): Bool;
  530. function DPtoTP(lpPnt: PPoint; cPnt: Integer): Bool;
  531. procedure BoundingRectFromPoints(lpPnt: PPoint; cPnt: Integer;
  532.   lpRectBound: PRect);
  533. function SymbolToCharacter(lpsyv: PSYV; cSyv: Integer; lpstr: PStr;
  534.   lpnConv: PInteger): Bool;
  535. function CharacterToSymbol(lpstr: PStr; cSyv: Integer; lpsyv: PSYV): Integer;
  536. function GetVersionPenWin: Word;
  537. function ExecuteGesture(hw: HWnd; syv: TSYV; lprcresult: PRCResult): Bool;
  538.  
  539. {***** RC Options and Flags  **********************************************}
  540.  
  541. const
  542.   alc_All                = $000043FF;
  543.   alc_Default            = $00000000;
  544.   alc_LCAlpha            = $00000001;
  545.   alc_UCAlpha            = $00000002;
  546.   alc_Alpha              = $00000003;
  547.   alc_Numeric            = $00000004;
  548.   alc_Alphanumeric       = $00000007;
  549.   alc_Punc               = $00000008;
  550.   alc_Math               = $00000010;
  551.   alc_Monetary           = $00000020;
  552.   alc_Other              = $00000040;
  553.   alc_White              = $00000100;
  554.   alc_NonPrint           = $00000200;
  555.   alc_Gesture            = $00004000;
  556.   alc_UseBitmap          = $00008000;
  557.   alc_DBCS               = $00000400;
  558.   alc_Hiragana           = $00010000;
  559.   alc_Katakana           = $00020000;
  560.   alc_Kanji              = $00040000;
  561.   alc_OEM                = $0FF80000;
  562.   alc_Reserved           = $F0003800;
  563.   alc_NoPriority         = $00000000;
  564.   alc_SysMinimum         = alc_Alphanumeric or
  565.                            alc_Punc or alc_White or
  566.                            alc_Gesture;
  567.  
  568. { macros }
  569. function MpAlcB(lprc: PRC; i: Word): PByte;
  570. function MpIbf(i: Word): Byte;
  571.  
  572. procedure SetAlcBitAnsi(lprc: PRC; i: Word);
  573. procedure ResetAlcBitAnsi(lprc: PRC; i: Word);
  574. function IsAlcBitAnsi(lprc: PRC; i: Word): Boolean;
  575.  
  576. const
  577.   rcd_Default            = 0;
  578.   rcd_LR                 = 1;
  579.   rcd_RL                 = 2;
  580.   rcd_TB                 = 3;
  581.   rcd_BT                 = 4;
  582.  
  583. const
  584.   rco_NoPointerEvent     = $00000001;
  585.   rco_SaveAllData        = $00000002;
  586.   rco_SaveHPenData       = $00000004;
  587.   rco_NoFlashUnknown     = $00000008;
  588.   rco_TabletCoord        = $00000010;
  589.   rco_NoSpaceBreak       = $00000020;
  590.   rco_NoHideCursor       = $00000040;
  591.   rco_NoHook             = $00000080;
  592.   rco_Boxed              = $00000100;
  593.   rco_Suggest            = $00000200;
  594.   rco_DisableGesMap      = $00000400;
  595.   rco_NoFlashCursor      = $00000800;
  596.   rco_ColdRecog          = $00008000;
  597.  
  598. const
  599.   rcp_LeftHand           = $0001;
  600.   rcp_MapChar            = $0004;
  601.  
  602. const
  603.   rcor_Normal            = 1;
  604.   rcor_Right             = 2;
  605.   rcor_Upsidedown        = 3;
  606.   rcor_Left              = 4;
  607.  
  608.   rrm_Stroke             = 0;
  609.   rrm_Symbol             = 1;
  610.   rrm_Word               = 2;
  611.   rrm_NewLine            = 3;
  612.   rrm_Complete           = 16;
  613.  
  614.   rcip_AllAnsiChar       = $0001;
  615.   rcip_Mask              = $0001;
  616.  
  617.   cwr_StripCR            = $00000001;
  618.   cwr_StripLF            = $00000002;
  619.   cwr_StripTAB           = $00000004;
  620.   cwr_SingleLineEdit     = $00000007;
  621.   cwr_Title              = $00000010;
  622.   cwr_KKConvert          = $00000020;
  623.  
  624. const
  625.   map_GestOGES        = rcrt_Gesture or rcrt_GestureTranslated;
  626.   map_GestOVKeys      = rcrt_GestureToKeys or rcrt_AlreadyProcessed;
  627.  
  628.  
  629. { macros }
  630. function IsGestureToGesture(lprcresult: PRCResult): Boolean;
  631. function IsGestureToVkeys(lprcresult: PRCResult): Boolean;
  632. procedure SetAlreadyProcessed(lprcresult: PRCResult);
  633.  
  634.  
  635. {***** Pen Data Type ******************************************************}
  636.  
  637. type
  638.   PPenDataHeader = ^TPenDataHeader;
  639.   TPenDataHeader = record
  640.     wVersion: Word;
  641.     cbSizeUsed: Word;
  642.     cStrokes: Word;
  643.     cPnt: Word;
  644.     cPntStrokeMax: Word;
  645.     rectBound: TRect;
  646.     wPndts: Word;
  647.     nInkWidth: Integer;
  648.     rgbInk: Longint;
  649.   end;
  650.  
  651. const
  652.   pdts_LOMetric          = $0000;
  653.   pdts_HIMetric          = $0001;
  654.   pdts_HIEnglish         = $0002;
  655.   pdts_ScaleMax          = $0003;
  656.   pdts_Display           = $0003;
  657.   pdts_Arbitrary         = $0004;
  658.   pdts_ScaleMask         = $000F;
  659.   pdts_StandardScale     = pdts_HIEnglish;
  660.  
  661.   pdts_NoPenInfo         = $0100;
  662.   pdts_NoUpPoints        = $0200;
  663.   pdts_NoOEMData         = $0400;
  664.   pdts_NoColinear        = $0800;
  665.   pdts_Compressed        = $8000;
  666.   pdts_CompressMethod    = $00F0;
  667.   pdts_Compress2ndDeriv  = $0010;
  668.  
  669.   pdtt_Default           = $0000;
  670.   pdtt_PenInfo           = pdts_NoPenInfo;
  671.   pdtt_UpPoints          = pdts_NoUpPoints;
  672.   pdtt_OEMdata           = pdts_NoOEMData;
  673.   pdtt_Colinear          = pdts_NoColinear;
  674.   pdtt_Compress          = pdts_Compressed;
  675.   pdtt_Decompress        = $4000;
  676.   pdtt_All = pdtt_PenInfo or pdtt_UpPoints or pdtt_OEMdata or pdtt_Colinear;
  677.  
  678.  
  679. { macros }
  680. function DestroyPenData(hPenData: THPenData): Boolean;
  681. procedure EndEnumStrokes(hPenData: THPenData);
  682.  
  683.  
  684. function IsPenEvent(Message: Word; lExtraInfo: Longint): Bool;
  685. function GetPenAsyncState(wPDK: Word): Bool;
  686. function GetPenDataInfo(hPenData: THPenData; lppendataheader: PPenDataHeader;
  687.   lpPenInfo: PPenInfo; dwReserved: Longint): Bool;
  688. function GetPenDataStroke(lppendata: PPenDataHeader; wStroke: Word;
  689.   lplpPoint: PPoint; lplpvOem: Pointer; lpsi: PStrokeInfo ): Bool;
  690. function GetPointsFromPenData(hPenData: PPenDataHeader; wStroke, wPnt, cPnt: Word;
  691.   lppoint: PPoint): Bool;
  692. procedure DrawPenData(DC: HDC; lprect: PRect; hPenData: THPenData);
  693. function MetricScalePenData(hPenData: THPenData; wPdts: Word): Bool;
  694. function ResizePenData(hPenData: THPenData;  lprect: PRect): Bool;
  695. function OffsetPenData(hPenData: THPenData; dx, dy: Integer): Bool;
  696. function RedisplayPenData(DC:HDC; hPenData: THPenData; lpDelta: PPoint;
  697.   lpExt: PPoint; nInkWidth: Integer; rgbColor: Longint): Bool;
  698. function CompactPenData(hPenData: THPenData; wTrimOptions: Word): THPenData;
  699. function DuplicatePenData(hPenData:THPenData; gmemFlags: Word): THPenData;
  700. function CreatePenData(lpPenInfo: PPenInfo; cbOemData: Integer;
  701.   wPdtScale: Word; gmemFlags: Word): THPenData;
  702. function AddPointsPenData(hPenData: THPenData; lpPnt: PPoint;
  703.   lpvOemData: Pointer; lpsiNew: PStrokeInfo): THPenData;
  704. function BeginEnumStrokes(hPenData: THPenData): PPenDataHeader;
  705.  
  706. {***** New Windows Messages ***********************************************}
  707.  
  708. const
  709.   wm_RCResult            = wm_PenWinFirst+1;
  710.   wm_HookRCResult        = wm_PenWinFirst+2;
  711.   wm_GlobalRCChange      = wm_PenWinFirst+3;
  712.   wm_SKB                 = wm_PenWinFirst+4;
  713.   wm_HEditCtl            = wm_PenWinFirst+5;
  714.  
  715. {***** Dictionary *********************************************************}
  716.  
  717. const
  718.   cbDictPathMax          = 255;
  719.   dirq_Query             = 1;
  720.   dirq_Description       = 2;
  721.   dirq_Configure         = 3;
  722.   dirq_Open              = 4;
  723.   dirq_Close             = 5;
  724.   dirq_SetWordLists      = 6;
  725.   dirq_String            = 7;
  726.   dirq_Suggest           = 8;
  727.   dirq_Add               = 9;
  728.   dirq_Delete            = 10;
  729.   dirq_Flush             = 11;
  730.   dirq_RCChange          = 12;
  731.   dirq_SymbolGraph       = 13;
  732.   dirq_Init              = 14;
  733.   dirq_Cleanup           = 15;
  734.   dirq_Copyright         = 16;
  735.  
  736.  
  737.   dirq_User              = 4096;
  738.  
  739. function DictionarySearch(lprc: PRC; lpsye: PSYE; cSye: Integer;
  740.   lpsyv: PSYV; cSyvMax: Integer): Bool;
  741.  
  742. {***** Handwriting Edit Control *******************************************}
  743.  
  744. const
  745.   he_GetRC               = 3;
  746.   he_SetRC               = 4;
  747.   he_GetInflate          = 5;
  748.   he_SetInflate          = 6;
  749.   he_GetUnderline        = 7;
  750.   he_SetUnderline        = 8;
  751.   he_GetInkHandle        = 9;
  752.   he_SetInkMode          = 10;
  753.   he_StopInkMode         = 11;
  754.   he_GetRCResultCode     = 12;
  755.   he_DefaultFont         = 13;
  756.   he_CharPosition        = 14;
  757.   he_CharOffset          = 15;
  758.  
  759.   he_GetRCResult         = 22;
  760.  
  761.   he_KKConvert           = 30;
  762.   he_GetKKConvert        = 31;
  763.   he_CancelKKConvert     = 32;
  764.   he_FixKKConvert        = 33;
  765.  
  766.   hekk_Default           = 0;
  767.   hekk_Convert           = 1;
  768.   hekk_Candidate         = 2;
  769.  
  770.   hep_NoRecog            = 0;
  771.   hep_Recog              = 1;
  772.   hep_WaitForTap         = 2;
  773.  
  774.   hn_EndRec              = 4;
  775.   hn_DelayedRecogFail    = 5;
  776.  
  777.   hn_RCResult            = 20;
  778.  
  779.   hn_EndKKConvert        = 30;
  780.  
  781.  
  782. type
  783.   PRectOfs = ^TRectOfs;
  784.   TRectOfs = record
  785.     dLeft: Integer;
  786.     dTop: Integer;
  787.     dRight: Integer;
  788.     dBottom: Integer;
  789.   end;
  790.  
  791. {***** Boxed Edit Control *************************************************}
  792.  
  793. type
  794.   PBoxLayout = ^TBoxLayout;
  795.   TBoxLayout = record
  796.     cyCusp: Integer;
  797.     cyEndCusp: Integer;
  798.     Style: Word;
  799.     rgbText: Longint;
  800.     rgbBox: Longint;
  801.     rgbSelect: Longint;
  802.   end;
  803.  
  804. const
  805.   bxs_None               = 0;
  806.   bxs_Rect               = 1;
  807.   bxs_EndTextmark        = 2;
  808.   bxs_Mask               = 3;
  809.  
  810.   he_GetBoxLayout        = 20;
  811.   he_SetBoxLayout        = 21;
  812.  
  813.   bxd_CellWidth          = 12;
  814.   bxd_CellHeight         = 16;
  815.   bxd_BaseHeight         = 13;
  816.   bxd_BaseHorz           = 0;
  817.   bxd_CuspHeight         = 2;
  818.   bxd_EndCuspHeight      = 4;
  819.  
  820. {***** Screen Keyboard ****************************************************}
  821.  
  822. type
  823.   PSKBInfo = ^TSKBInfo;
  824.   TSKBInfo = record
  825.     handle: HWnd;
  826.     nPad: Word;
  827.     fVisible: Bool;
  828.     fMinimized: Bool;
  829.     hect: TRect;
  830.     dwReserved: Longint;
  831.   end;
  832.  
  833. const
  834.   skb_Query              = $0000;
  835.   skb_Show               = $0001;
  836.   skb_Hide               = $0002;
  837.   skb_Center             = $0010;
  838.   skb_Move               = $0020;
  839.   skb_Minimize           = $0040;
  840.   skb_Full               = $0100;
  841.   skb_Basic              = $0200;
  842.   skb_NumPad             = $0400;
  843.  
  844. const
  845.   obm_SKBBtnUp           = 32767;
  846.   obm_SKBBtnDown         = 32766;
  847.   obm_SKBBtnDisabled     = 32765;
  848.  
  849.   skn_Changed            = 1;
  850.  
  851.   skn_PosChanged         = 1;
  852.   skn_PadChanged         = 2;
  853.   skn_MinChanged         = 4;
  854.   skn_VisChanged         = 8;
  855.   skn_Terminated         = $FFFF;
  856.  
  857. function ShowKeyboard(Handle: HWnd; wCommand: Word; lpPnt: PPoint;
  858.   lpSKBInfo: PSKBInfo): Bool;
  859.  
  860. {***** New ComboBox Notifications  ****************************************}
  861.  
  862. const
  863.   cbn_EndRec             = 16;
  864.   cbn_DelayedRecogFail   = 17;
  865.   cbn_RcResult           = 18;
  866.  
  867.  
  868. {**********************************************************************
  869.     APIs into recognizer layer.
  870.  **********************************************************************}
  871.  
  872. type
  873.   TFuncResults = function(lprcresult: PRCResult; R: TRec): Integer;
  874.  
  875. { Initialization Functions }
  876.  
  877. const
  878.   wcr_RecogName          = 0;
  879.   wcr_Query              = 1;
  880.   wcr_ConfigDialog       = 2;
  881.   wcr_Default            = 3;
  882.   wcr_RCChange           = 4;
  883.   wcr_Version            = 5;
  884.   wcr_Train              = 6;
  885.   wcr_TrainSave          = 7;
  886.   wcr_TrainMax           = 8;
  887.   wcr_TrainDirty         = 9;
  888.   wcr_TrainCustom        = 10;
  889.   wcr_QueryLanguage      = 11;
  890.   wcr_UserChange         = 12;
  891.   wcr_Private            = 1024;
  892.  
  893. { sub-function of wcr_UserChange }
  894. const
  895.   cruc_Remove            = 1;
  896.  
  897. { Return values for wcr_Train Function }
  898. const
  899.   Train_None             = $0000;
  900.   Train_Default          = $0001;
  901.   Train_Custom           = $0002;
  902.   Train_Both             = Train_Default or Train_Custom;
  903.  
  904. { Control values for TrainSave }
  905. const
  906.   Train_Save             = 0;  { Save changes that have been made }
  907.   Train_Revert           = 1;  { Discard changes that have been made }
  908.  
  909. function ConfigRecognizer(wConfigRecog: Word; wParam: Word;
  910.   lParam: Longint ): Word;
  911. function InitRecognizer(lprc: PRC): Bool;
  912. procedure CloseRecognizer;
  913.  
  914. { Recognition Functions }
  915. function RecognizeInternal(lprc: PRC; lpfuncresults: TFuncResults): TRec;
  916. function RecognizeDataInternal(lprc: PRC; hPenData: THPenData;
  917.   lpfuncresults: TFuncResults): TRec;
  918.  
  919. { Training Functions }
  920. function TrainInkInternal(lprc: PRC; hPenData: THPenData; lpsyv: PSYV): Bool;
  921. function TrainContextInternal(lprcresult: PRCResult; lpsye: PSYE;
  922.   cSye: Integer; lpsyc: PSYC; cSyc: Integer): Bool;
  923.  
  924.  
  925. implementation
  926.  
  927. type
  928.   LongRec = record
  929.     Lo, Hi: Word;
  930.   end;
  931.  
  932.   WordRec = record
  933.     Lo, Hi: Byte;
  934.   end;
  935.  
  936. { translations of macros }
  937.  
  938. function ChSyvToAnsi(syv: Longint): Byte;
  939. begin
  940.   ChSyvToAnsi := WordRec(LongRec(syv).Lo).Lo;
  941. end;
  942.  
  943. function SyvCharacterToSymbol(c: Char): Longint;
  944. begin
  945.   SyvCharacterToSymbol := Byte(c) or $10000;
  946. end;
  947.  
  948. function SyvKanjiToSymbol(c: Char): TSYV;
  949. begin
  950.   SyvKanjiToSymbol := Byte(c) or $30000;
  951. end;
  952.  
  953. function FIsStdGesture(syv: Longint): Boolean;
  954. begin
  955.   FIsStdGesture := (syv = syv_Clear) or (syv = syv_ExtendSelect) or
  956.     (syv = syv_Undo) or (syv = syv_Copy) or (syv = syv_Cut) or
  957.     (syv = syv_Paste) or (syv = syv_ClearWord) or (syv = syv_KKConvert) or
  958.     (syv = syv_User) or (syv = syv_Correct);
  959. end;
  960.  
  961. function FIsAnsiGesture(syv: TSYV): Boolean;
  962. begin
  963.   FIsAnsiGesture := (syv = syv_Backspace) or (syv = syv_Tab) or
  964.     (syv = syv_Return) or (syv = syv_Space);
  965. end;
  966.  
  967. { Gesture macros }
  968.  
  969. function FIsLoAppGesture(syv: Longint): Boolean;
  970. begin
  971.   FIsLoAppGesture := (syv >= syv_CircleLoA) and (syv <= syv_CircleLoZ);
  972. end;
  973.  
  974. function FIsUpAppGesture(syv: Longint): Boolean;
  975. begin
  976.   FIsUpAppGesture := (syv >= syv_CircleUpA) and (syv <= syv_CircleUpZ);
  977. end;
  978.  
  979. function FIsAppGesture(syv: Longint): Boolean;
  980. begin
  981.   FIsAppGesture := (syv >= syv_CircleUpA) and (syv <= syv_CircleLoZ);
  982. end;
  983.  
  984. function SyvAppGestureFromLoAnsi(Ansi: Char): TSYV;
  985. begin
  986.   SyvAppGestureFromLoAnsi := Byte( (Ord(Ansi) - Ord('a')) + syv_CircleLoA );
  987. end;
  988.  
  989. function SyvAppGestureFromUpAnsi(Ansi: Char): TSYV;
  990. begin
  991.   SyvAppGestureFromUpAnsi := Byte( (Ord(Ansi) - Ord('A')) + syv_CircleUpA );
  992. end;
  993.  
  994. function AnsiFromSyvAppGesture(syv: TSYV): Byte;
  995. begin
  996.   if FIsUpAppGesture(syv) then syv := syv_CircleUpA - TSYV('A')
  997.   else syv := syv_CircleLoA - TSYV('a');
  998.   AnsiFromSyvAppGesture := ChSyvToAnsi(syv);
  999. end;
  1000.  
  1001. function FIsSpecial(syv: TSYV): Boolean;
  1002. begin
  1003.   FIsSpecial := LongRec(syv).Hi = syvhi_Special;
  1004. end;
  1005.  
  1006. function FIsAnsi(syv: TSYV): Boolean;
  1007. begin
  1008.   FIsAnsi := LongRec(syv).Hi = syvhi_ANSI;
  1009. end;
  1010.  
  1011. function FIsGesture(syv: TSYV): Boolean;
  1012. begin
  1013.   FIsGesture := LongRec(syv).Hi = syvhi_Gesture;
  1014. end;
  1015.  
  1016. function FIsKanji(syv: TSYV): Boolean;
  1017. begin
  1018.   FIsKanji := LongRec(syv).Hi = syvhi_Kanji;
  1019. end;
  1020.  
  1021. function FIsShape(syv: TSYV): Boolean;
  1022. begin
  1023.   FIsShape := LongRec(syv).Hi = syvhi_Shape;
  1024. end;
  1025.  
  1026. function FIsUniCode(syv: TSYV): Boolean;
  1027. begin
  1028.   FIsUniCode := LongRec(syv).Hi = syvhi_UniCode;
  1029. end;
  1030.  
  1031. function FIsVKey(syv: TSYV): Boolean;
  1032. begin
  1033.   FIsVKey := LongRec(syv).Hi = syvhi_VKey;
  1034. end;
  1035.  
  1036. function GetWEventRef: Word;
  1037. var
  1038.   Result: Longint;
  1039. begin
  1040.   Result := GetMessageExtraInfo;
  1041.   GetWEventRef := LongRec(Result).Lo;
  1042. end;
  1043.  
  1044. function MpAlcB(lprc: PRC; i: Word): PByte;
  1045. begin
  1046.   MpAlcB := @lprc^.rgbfAlc[ (i and $FF) shr 3 ];
  1047. end;
  1048.  
  1049. function MpIbf(i: Word): Byte;
  1050. begin
  1051.   MpIbf := 1 shl (i and 7);
  1052. end;
  1053.  
  1054. procedure SetAlcBitAnsi(lprc: PRC; i: Word);
  1055. var
  1056.   P: PByte;
  1057. begin
  1058.   P := MpAlcB(lprc, i);
  1059.   P^ := P^ or MpIbf(i);
  1060. end;
  1061.  
  1062. procedure ResetAlcBitAnsi(lprc: PRC; i: Word);
  1063. var
  1064.   P: PByte;
  1065. begin
  1066.   P := MpAlcB(lprc, i);
  1067.   P^ := P^ and not MpIbf(i);
  1068. end;
  1069.  
  1070. function IsAlcBitAnsi(lprc: PRC; i: Word): Boolean;
  1071. begin
  1072.   IsAlcBitAnsi := MpAlcB(lprc,i)^ and MpIbf(i) <> 0;
  1073. end;
  1074.  
  1075. function IsGestureToGesture(lprcresult: PRCResult): Boolean;
  1076. begin
  1077.   IsGestureToGesture :=
  1078.     (lprcresult^.wResultsType and map_GestOGES) = map_GestOGES;
  1079. end;
  1080.  
  1081. function IsGestureToVkeys(lprcresult: PRCResult): Boolean;
  1082. begin
  1083.   IsGestureToVkeys :=
  1084.     (lprcresult^.wResultsType and map_GestOVKeys) = map_GestOVKeys;
  1085. end;
  1086.  
  1087. procedure SetAlreadyProcessed(lprcresult: PRCResult);
  1088. begin
  1089.   lprcresult^.wResultsType :=
  1090.     (lprcresult^.wResultsType and (not rcrt_GestureToKeys)) or rcrt_AlreadyProcessed;
  1091. end;
  1092.  
  1093. function DestroyPenData(hPenData: THPenData): Boolean;
  1094. begin
  1095.   DestroyPenData := GlobalFree(hPenData) = 0;
  1096. end;
  1097.  
  1098. procedure EndEnumStrokes(hPenData: THPenData);
  1099. begin
  1100.   GlobalUnlock(hPenData);
  1101. end;
  1102.  
  1103. procedure UpdatePenInfo;                     external 'PENWIN' index 207;
  1104. function EndPenCollection;                   external 'PENWIN' index 137;
  1105. function GetPenHwData;                       external 'PENWIN' index 138;
  1106. function GetPenHwEventData;                  external 'PENWIN' index 139;
  1107. function SetPenHook;                         external 'PENWIN' index 115;
  1108. procedure PostVirtualKeyEvent;               external 'PENWIN' index 102;
  1109. procedure PostVirtualMouseEvent;             external 'PENWIN' index 101;
  1110. procedure AtomicVirtualEvent;                external 'PENWIN' index 104;
  1111. function InstallRecognizer;                  external 'PENWIN' index 14;
  1112. procedure UninstallRecognizer;               external 'PENWIN' index 15;
  1113. function GetGlobalRC;                        external 'PENWIN' index 151;
  1114. function SetGlobalRC;                        external 'PENWIN' index 150;
  1115. procedure RegisterPenApp;                    external 'PENWIN' index 111;
  1116. function IsPenAware;                         external 'PENWIN' index 110;
  1117. function SetRecogHook;                       external 'PENWIN' index 114;
  1118. procedure InitRC;                            external 'PENWIN' index 10;
  1119. function Recognize;                          external 'PENWIN' index 11;
  1120. function RecognizeData;                      external 'PENWIN' index 12;
  1121. function TrainInk;                           external 'PENWIN' index 16;
  1122. function TrainContext;                       external 'PENWIN' index 17;
  1123. function ProcessWriting;                     external 'PENWIN' index 170;
  1124. function CorrectWriting;                     external 'PENWIN' index 172;
  1125. procedure EmulatePen;                        external 'PENWIN' index 173;
  1126. function GetSymbolMaxLength;                 external 'PENWIN' index 121;
  1127. function GetSymbolCount;                     external 'PENWIN' index 122;
  1128. procedure FirstSymbolFromGraph;              external 'PENWIN' index 123;
  1129. function EnumSymbols;                        external 'PENWIN' index 124;
  1130. function TPtoDP;                             external 'PENWIN' index 132;
  1131. function DPtoTP;                             external 'PENWIN' index 131;
  1132. procedure BoundingRectFromPoints;            external 'PENWIN' index 13;
  1133. function SymbolToCharacter;                  external 'PENWIN' index 125;
  1134. function CharacterToSymbol;                  external 'PENWIN' index 126;
  1135. function GetVersionPenWin;                   external 'PENWIN' index 402;
  1136. function ExecuteGesture;                     external 'PENWIN' index 418;
  1137. function IsPenEvent;                         external 'PENWIN' index 135;
  1138. function GetPenAsyncState;                   external 'PENWIN' index 144;
  1139. function GetPenDataInfo;                     external 'PENWIN' index 211;
  1140. function GetPenDataStroke;                   external 'PENWIN' index 219;
  1141. function GetPointsFromPenData;               external 'PENWIN' index 221;
  1142. procedure DrawPenData;                       external 'PENWIN' index 214;
  1143. function MetricScalePenData;                 external 'PENWIN' index 215;
  1144. function ResizePenData;                      external 'PENWIN' index 222;
  1145. function OffsetPenData;                      external 'PENWIN' index 216;
  1146. function RedisplayPenData;                   external 'PENWIN' index 242;
  1147. function CompactPenData;                     external 'PENWIN' index 223;
  1148. function DuplicatePenData;                   external 'PENWIN' index 218;
  1149. function CreatePenData;                      external 'PENWIN' index 210;
  1150. function AddPointsPenData;                   external 'PENWIN' index 212;
  1151. function BeginEnumStrokes;                   external 'PENWIN' index 213;
  1152. function DictionarySearch;                   external 'PENWIN' index 420;
  1153. function ShowKeyboard;                       external 'PENWIN' index 250;
  1154.  
  1155. { Additions from PENWOEM.H, using MARS.DLL }
  1156.  
  1157. function ConfigRecognizer;                   external 'MARS' index 4;
  1158. function InitRecognizer;                     external 'MARS' index 5;
  1159. procedure CloseRecognizer;                   external 'MARS' index 6;
  1160. function RecognizeInternal;                  external 'MARS' index 2;
  1161. function RecognizeDataInternal;              external 'MARS' index 3;
  1162. function TrainInkInternal;                   external 'MARS' index 7;
  1163. function TrainContextInternal;               external 'MARS' index 8;
  1164.  
  1165. end.
  1166.